<?php

Route::group(['middleware' => ['web', 'admin'], 'domain' => env('SHOP_HOST', ''), 'namespace' => 'Modules\Shop\Http\Controllers'], function () {
    /* 无需登录 + 无需权限路由 */
    Route::get('shop_finance_graphs', ['as' => 'shop_finance_graphs', 'uses' => 'IndexController@finance_graphs']);//财务图表统计

    //地图拾取
    Route::get('shop-author-openMap', ['as' => 'shop_author_openMap', 'uses' => 'AuthorController@openMap']);
    //检测手机号或门店名称是否存在
    Route::get('shop-author-data-monitoring', ['as' => 'shop_author_data_monitoring', 'uses' => 'AuthorController@dataMonitoring']);
    //图片上传
    Route::post('shop-upload-img', ['as' => 'shop_upload_img', 'uses' => 'PublicController@uploadImg']);
    Route::post('shop-area-coordinate', ['as' => 'shop_area_coordinate', 'uses' => 'PublicController@areaCoordinate']);//区县坐标


    Route::post('admin-upload-img', ['as' => 'admin_upload_img', 'uses' => 'PublicController@uploadImg']); //图片上传
    Route::get('admin-province', ['as' => 'admin_province', 'uses' => 'PublicController@getProvinceList']);//省列表
    Route::post('admin-get-list', ['as' => 'admin_get_list', 'uses' => 'PublicController@getList']);//城市-区县列表
    Route::get('shop-logistics-tracking', ['as' => 'shop_logistics_tracking', 'uses' => 'PublicController@logisticsTracking']);//物流追踪

    /* 无需权限 + 判断是否已登录，登录直接跳转到主页 */
    Route::group(['middleware' => 'shop_has_logined'], function () {
        //登录 登录操作
        Route::get('shop-login', ['as' => 'shop_login', 'uses' => 'IndexController@login']);//登录页面
        Route::put('shop-login-in', ['as' => 'shop_login_in', 'uses' => 'IndexController@login_in']);//登录操作
    });

    /* 无需权限 + 判断是否已登录，未登录直接跳转到登录页面 */
    Route::group(['middleware' => ['shop_is_login']], function () {
        Route::get('/', ['as' => 'shop_index', 'uses' => 'IndexController@main']);//主页页面
//        Route::get('shop-check_menu', ['as' => 'shop_check_menu', 'uses' => 'IndexController@check_menu']);//根据头部菜单检测左侧菜单
        Route::get('shop-welcome', ['as' => 'shop_welcome', 'uses' => 'IndexController@welcome']);//欢迎页面
        Route::get('shop-login-out', ['as' => 'shop_login_out', 'uses' => 'IndexController@login_out']);//退出登录
    });

    /* 判断权限 + 判断是否已登录，未登录直接跳转到登录页面 */
    Route::group(['middleware' => ['shop_is_login', 'shop_is_auth', 'shop_action_log']], function () {
        require_once __DIR__ . '/temp_route/wu_route.php';
        require_once __DIR__ . '/temp_route/huqin_route.php';
        require_once __DIR__ . '/temp_route/yangxiaodong_route.php';
    });


});
